package com.epfresh.views.dialog;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.epfresh.R;
import com.epfresh.bean.ProductCondition;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wzh on 16-7-13.
 */
public class ProductConditionDialog extends BaseDialogView{

    TextView tvContent;
    public ProductConditionDialog(Context context) {
        super(context);

        init();
    }

    @Override
    public void initBefore() {
        setGravity(Gravity.TOP);
    }

    @Override
    protected void initAnim() {
        super.initAnim();
    }

    private void init() {

        View v = LayoutInflater.from(context).inflate(R.layout.dialog_more_market_layout, contentContainer);

        tvContent = (TextView) v.findViewById(R.id.tv_content);

        setCancelable(true);

    }

    public void reSizeLocation(int top){
        FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) rootView.getLayoutParams();
        lp.topMargin = top;
//                +context.getResources().getDimensionPixelSize(R.dimen.line_large_width);
    }

    public void marketTop(){
        int top = context.getResources().getDimensionPixelSize(R.dimen.action_bar_height)
                +context.getResources().getDimensionPixelSize(R.dimen.home_top_nav_height) *2
                +context.getResources().getDimensionPixelSize(R.dimen.distance_huge_10);
        reSizeLocation(top);
    }
    public void resultTop(){
        int top = context.getResources().getDimensionPixelSize(R.dimen.action_bar_height)
                +context.getResources().getDimensionPixelSize(R.dimen.home_top_nav_height)
                +context.getResources().getDimensionPixelSize(R.dimen.distance_huge_10);
        reSizeLocation(top);
    }

    public void hideContent(){
        tvContent.setVisibility(View.GONE);
    }

    public void showEmpty(){
        tvContent.setVisibility(View.VISIBLE);
    }



}
